package com.example.demo01.Controller.mobileController;

import com.alibaba.fastjson.JSON;
import com.example.demo01.Entity.mobileEntity.UserInfo;
import com.example.demo01.Service.mobileService.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserInfoController  {
    @Autowired
    private UserInfoService userInfoService;

    /**
     * 根据用户名&密码获取用户的基本信息
     * @param account
     * @param password
     * @return
     */
    @RequestMapping("/userinfo/GET/byaccount")
    public String getUserInfoInstanceByAccount(
            @RequestParam(value = "account") String account,
            @RequestParam(value = "password") String password)
    {
        return JSON.toJSONString(userInfoService.getUserInfoInstanceByAccount(account,password));
    }
}
